|
 |
|
METHOD:
String::charCodeAt
object.charCodeAt(index)
This method returns
a character's Unicode value from a string by referring to it's index within that string.
The characters in a string are indexed from left to right with the first
character indexed as 0 and the last as String.length - 1.
The following code reads a character from the string at the specified index and writes it's Unicode value to the document.
Code:
myString = new String("charCodeAt method demonstration.")
document.write (myString.charCodeAt(2))
Output:
65
Copyright 2000 by Infinite Software
Solutions, Inc.
Trademark Information
|